Dynomotion

Group: DynoMotion Message: 5059 From: Henk Sterk Date: 5/25/2012
Subject: Spindle calibration with Mach3
Attachments :
    Hi Tom,
     
    I've got a Yaskawa Servo Drive for the spindle (DAC4), it's all working great under KFlop-Kanalog.
    Communication with Mach3 works well, meaning M3, M4 and M5 all ok.
    When M3 S1000 is input I've got 250prm on the shaft (handheld Tacho ) and 930 on Mach3 RPM readout.
    So somehow Mach3 receives pulses from KFlop.
    Can't find any settings to calibrate this, so I started adjusting the output pulses from the Yaskawa Drive (ended up with 511, max is 2048), and
    also adjusted the multiplier for the DAC output (ended up with 1840 was 2047), it's very close, but I think and hope there is a better way?
     
    Issue 2:
     
    I get multiple messages when I change from M3S2000 to M4S1000 (see attached screen shot)
    it also first change speed from 2000 to 1000 then stop (instruction from Mach3 I guess) the reverse rotation.
     
    Any tips for me?
     
    Many thanks
     
    Henk
     
    Group: DynoMotion Message: 5063 From: Tom Kerekes Date: 5/25/2012
    Subject: Re: Spindle calibration with Mach3 [1 Attachment]
    Hi Henk,
     
    To get the Mach3 RPM display to be accurate you would need to set the proper number of encoder counts/rev in the:
     
    Mach3 | Config Plugins | Dynomotion Screen.
     
    To get the Commanded Sxxxx Speed to be correct there are two possible approaches:
     
    #1 - do it open loop as you are now.  In this case the DAC voltage needs to be scaled and assumed to be linear such that we get the right speed.  Mach3 has a "pulley speed" concept.  If the Mach3 max Pulley Speed is set for say 2000 RPM then a S1500 Gcode command will send a relative pully speed of 0.75 to the Mach3Spindle.c program.  You will then need to apply a factor to 0.75 to output the correct DAC counts (2047=10V) such that the Servo drive will run at the desired speed. 
     
    This approach is fairly simple, but because it is open loop and relies on an analog voltage and so forth the speed may be off by some amount (1% ??).
     
     
    #2 - use a closed loop method.  This would involve configuring a KFLOP axis channel as a servo with DAC output and encoder feedback.  You would then need to tune the PID + filters to get good speed control.  This is the Method that Bengt has been doing on previous Yahoo Group Posts over the last week or two.  Your system will be much easier because you have a real servo drive rather than a more basic VFD.  You also have a DAC for output so don't need to create a PWM C program and so forth.  It isn't clear how your Spindle reverses.  Are you switching relays or something?  But anyways those are details, once you have spindle control as an Axis Channel you can command speeds using Jog Commands.  A Jog command is essentially commanding the encoder to move at so many counts per second.  The DAC will regulate to whatever voltage is required to maintain that precise Jog Speed.  You should then have precise speed control.  Depending on load changes and such there might be some speed variation but the average speed will be guaranteed to be exact.
     
    Let me know how much of this makes sense.
     
    Regards
    TK 

    From: Henk Sterk <henk.sterk@...>
    To: DynoMotion@yahoogroups.com
    Sent: Friday, May 25, 2012 6:56 AM
    Subject: [DynoMotion] Spindle calibration with Mach3 [1 Attachment]

     
    Hi Tom,
     
    I've got a Yaskawa Servo Drive for the spindle (DAC4), it's all working great under KFlop-Kanalog.
    Communication with Mach3 works well, meaning M3, M4 and M5 all ok.
    When M3 S1000 is input I've got 250prm on the shaft (handheld Tacho ) and 930 on Mach3 RPM readout.
    So somehow Mach3 receives pulses from KFlop.
    Can't find any settings to calibrate this, so I started adjusting the output pulses from the Yaskawa Drive (ended up with 511, max is 2048), and
    also adjusted the multiplier for the DAC output (ended up with 1840 was 2047), it's very close, but I think and hope there is a better way?
     
    Issue 2:
     
    I get multiple messages when I change from M3S2000 to M4S1000 (see attached screen shot)
    it also first change speed from 2000 to 1000 then stop (instruction from Mach3 I guess) the reverse rotation.
     
    Any tips for me?
     
    Many thanks
     
    Henk
     


    Group: DynoMotion Message: 5068 From: Henk Sterk Date: 5/26/2012
    Subject: Re: Spindle calibration with Mach3
    Attachments :
      Ooooooo Yes, this works great, using the Jog command (close loop) insead of Dac (open loop).
      Still don't quite get  that the output count on the servo drive has to be 511 instead of 2048) but it works (sooo ?).
       
      All commands from Mach3 works, just the script script needs fine tuning (see attached)
       
      When M3 S1000 .......all fine
      Then  M4  S500  ....... first speed change (in same direction) then stop (Mach3 command I guess) then reverse to 500 rpm
       
      So it sort of works, but it can be improved (can you please help)
       
      Many thanks for your help.
       
      Best regards
       
      Henk


       
      On Sat, May 26, 2012 at 2:19 AM, Tom Kerekes <tk@...> wrote:
       

      Hi Henk,
       
      To get the Mach3 RPM display to be accurate you would need to set the proper number of encoder counts/rev in the:
       
      Mach3 | Config Plugins | Dynomotion Screen.
       
      To get the Commanded Sxxxx Speed to be correct there are two possible approaches:
       
      #1 - do it open loop as you are now.  In this case the DAC voltage needs to be scaled and assumed to be linear such that we get the right speed.  Mach3 has a "pulley speed" concept.  If the Mach3 max Pulley Speed is set for say 2000 RPM then a S1500 Gcode command will send a relative pully speed of 0.75 to the Mach3Spindle.c program.  You will then need to apply a factor to 0.75 to output the correct DAC counts (2047=10V) such that the Servo drive will run at the desired speed. 
       
      This approach is fairly simple, but because it is open loop and relies on an analog voltage and so forth the speed may be off by some amount (1% ??).
       
       
      #2 - use a closed loop method.  This would involve configuring a KFLOP axis channel as a servo with DAC output and encoder feedback.  You would then need to tune the PID + filters to get good speed control.  This is the Method that Bengt has been doing on previous Yahoo Group Posts over the last week or two.  Your system will be much easier because you have a real servo drive rather than a more basic VFD.  You also have a DAC for output so don't need to create a PWM C program and so forth.  It isn't clear how your Spindle reverses.  Are you switching relays or something?  But anyways those are details, once you have spindle control as an Axis Channel you can command speeds using Jog Commands.  A Jog command is essentially commanding the encoder to move at so many counts per second.  The DAC will regulate to whatever voltage is required to maintain that precise Jog Speed.  You should then have precise speed control.  Depending on load changes and such there might be some speed variation but the average speed will be guaranteed to be exact.
       
      Let me know how much of this makes sense.
       
      Regards
      TK 

      From: Henk Sterk <henk.sterk@...>
      To: DynoMotion@yahoogroups.com
      Sent: Friday, May 25, 2012 6:56 AM
      Subject: [DynoMotion] Spindle calibration with Mach3 [1 Attachment]

       
      Hi Tom,
       
      I've got a Yaskawa Servo Drive for the spindle (DAC4), it's all working great under KFlop-Kanalog.
      Communication with Mach3 works well, meaning M3, M4 and M5 all ok.
      When M3 S1000 is input I've got 250prm on the shaft (handheld Tacho ) and 930 on Mach3 RPM readout.
      So somehow Mach3 receives pulses from KFlop.
      Can't find any settings to calibrate this, so I started adjusting the output pulses from the Yaskawa Drive (ended up with 511, max is 2048), and
      also adjusted the multiplier for the DAC output (ended up with 1840 was 2047), it's very close, but I think and hope there is a better way?
       
      Issue 2:
       
      I get multiple messages when I change from M3S2000 to M4S1000 (see attached screen shot)
      it also first change speed from 2000 to 1000 then stop (instruction from Mach3 I guess) the reverse rotation.
       
      Any tips for me?
       
      Many thanks
       
      Henk
       



      Group: DynoMotion Message: 5073 From: Tom Kerekes Date: 5/26/2012
      Subject: Re: Spindle calibration with Mach3 [1 Attachment]
      Hi Henk,
       
      Regarding the 511/2048: that might be an encoder cycles vs counts factor of 4X issue.
       
      Regarding the direction change issue: I can't see a fix for that.  We just pass the messages straight through that our Plugin receives from Mach3.  For some reason it sends the speed change first, then stop, then speed change (with direction of -1 indicating a speed change when off, then a Spin on message.  So there is no way for us to know that a stop will come next.  The only suggestion I have is to set the Mach3 Spindle delays to zero to make it less noticable.  Or add an M5 when changing directions like:
       
      M3S1000
      M5
      M4S500
       
      TK

      From: Henk Sterk <henk.sterk@...>
      To: DynoMotion@yahoogroups.com
      Sent: Saturday, May 26, 2012 1:15 AM
      Subject: Re: [DynoMotion] Spindle calibration with Mach3 [1 Attachment]

       
      Ooooooo Yes, this works great, using the Jog command (close loop) insead of Dac (open loop).
      Still don't quite get  that the output count on the servo drive has to be 511 instead of 2048) but it works (sooo ?).
       
      All commands from Mach3 works, just the script script needs fine tuning (see attached)
       
      When M3 S1000 .......all fine
      Then  M4  S500  ....... first speed change (in same direction) then stop (Mach3 command I guess) then reverse to 500 rpm
       
      So it sort of works, but it can be improved (can you please help)
       
      Many thanks for your help.
       
      Best regards
       
      Henk


       
      On Sat, May 26, 2012 at 2:19 AM, Tom Kerekes <tk@...> wrote:
       
      Hi Henk,
       
      To get the Mach3 RPM display to be accurate you would need to set the proper number of encoder counts/rev in the:
       
      Mach3 | Config Plugins | Dynomotion Screen.
       
      To get the Commanded Sxxxx Speed to be correct there are two possible approaches:
       
      #1 - do it open loop as you are now.  In this case the DAC voltage needs to be scaled and assumed to be linear such that we get the right speed.  Mach3 has a "pulley speed" concept.  If the Mach3 max Pulley Speed is set for say 2000 RPM then a S1500 Gcode command will send a relative pully speed of 0.75 to the Mach3Spindle.c program.  You will then need to apply a factor to 0.75 to output the correct DAC counts (2047=10V) such that the Servo drive will run at the desired speed. 
       
      This approach is fairly simple, but because it is open loop and relies on an analog voltage and so forth the speed may be off by some amount (1% ??).
       
       
      #2 - use a closed loop method.  This would involve configuring a KFLOP axis channel as a servo with DAC output and encoder feedback.  You would then need to tune the PID + filters to get good speed control.  This is the Method that Bengt has been doing on previous Yahoo Group Posts over the last week or two.  Your system will be much easier because you have a real servo drive rather than a more basic VFD.  You also have a DAC for output so don't need to create a PWM C program and so forth.  It isn't clear how your Spindle reverses.  Are you switching relays or something?  But anyways those are details, once you have spindle control as an Axis Channel you can command speeds using Jog Commands.  A Jog command is essentially commanding the encoder to move at so many counts per second.  The DAC will regulate to whatever voltage is required to maintain that precise Jog Speed.  You should then have precise speed control.  Depending on load changes and such there might be some speed variation but the average speed will be guaranteed to be exact.
       
      Let me know how much of this makes sense.
       
      Regards
      TK 

      From: Henk Sterk <henk.sterk@...>
      To: DynoMotion@yahoogroups.com
      Sent: Friday, May 25, 2012 6:56 AM
      Subject: [DynoMotion] Spindle calibration with Mach3 [1 Attachment]

       
      Hi Tom,
       
      I've got a Yaskawa Servo Drive for the spindle (DAC4), it's all working great under KFlop-Kanalog.
      Communication with Mach3 works well, meaning M3, M4 and M5 all ok.
      When M3 S1000 is input I've got 250prm on the shaft (handheld Tacho ) and 930 on Mach3 RPM readout.
      So somehow Mach3 receives pulses from KFlop.
      Can't find any settings to calibrate this, so I started adjusting the output pulses from the Yaskawa Drive (ended up with 511, max is 2048), and
      also adjusted the multiplier for the DAC output (ended up with 1840 was 2047), it's very close, but I think and hope there is a better way?
       
      Issue 2:
       
      I get multiple messages when I change from M3S2000 to M4S1000 (see attached screen shot)
      it also first change speed from 2000 to 1000 then stop (instruction from Mach3 I guess) the reverse rotation.
       
      Any tips for me?
       
      Many thanks
       
      Henk